package server;

import io.vertx.core.Vertx;

public class VertHttpServer implements HttpServer{
    public void doStart(int port){
        Vertx vertx = Vertx.vertx();
        //创建一个http服务器
        io.vertx.core.http.HttpServer httpServer =  vertx.createHttpServer();
        //给服务器添加请求处理器
        httpServer.requestHandler(new HttpServerHandler());
        //启动服务器
        httpServer.listen(port,result -> {
            if(result.succeeded()){
                System.out.println("服务器正在监听：" + port + "端口");
            }else{
                System.out.println("服务器启动失败!");
            }
        });
    }
}
